package com.mic.gae.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.mic.gae.dto.BuildDTO;
import com.mic.gae.dto.BuildsDTO;
import com.mic.gae.dto.ConsoleContentDTO;
import com.mic.gae.dto.ConsoleDTO;
import com.mic.gae.dto.ProjectDTO;
import com.mic.gae.dto.ProjectsDTO;
import com.mic.gae.dto.ServerDTO;

public interface ContiniousIntegrationService {

	/**
	 * 
	 * @param serverDTO
	 * @return
	 */
	public ServerDTO addServer(ServerDTO serverDTO);

	/**
	 * 
	 * @param identity
	 * @param serverId
	 * @return
	 */
	public Long deleteServer(String identity, Long serverId);

	/**
	 * 
	 * @param identity
	 * @param serverId
	 * @return
	 */
	public ServerDTO getServer(String identity, Long serverId);

	/**
	 * 
	 * @param identity
	 * @return
	 */
	public List<ServerDTO> getServers(String identity);

	/**
	 * 
	 * @param serverId
	 * @return
	 * @throws IOException
	 */
	public ProjectsDTO getProjects(String identity, Long serverId) throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @return
	 * @throws IOException
	 */
	public ProjectDTO getProject(String identity, Long serverId, String projectName) throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @return
	 * @throws IOException
	 */
	public BuildsDTO getProjectBuilds(String identity, Long serverId, String projectName) throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @param buildNumber
	 * @return
	 * @throws IOException
	 */
	public BuildDTO getProjectBuild(String identity, Long serverId, String projectName, Long buildNumber)
	        throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @param buildNumber
	 * @return
	 * @throws IOException
	 */
	public ConsoleDTO getProjectConsole(String identity, Long serverId, String projectName, Long buildNumber)
	        throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @param buildNumber
	 * @param offset
	 * @param length
	 * @return
	 * @throws IOException
	 */
	public ConsoleContentDTO getProjectConsoleContent(String identity, Long serverId, String projectName,
	        Long buildNumber, Long offset, Long length) throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @param buildParameter
	 * @return
	 * @throws IOException
	 */
	public Map<String, String> startProjectBuild(String identity, Long serverId, String projectName,
	        Map<String, String> buildParameter) throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @param buildNumber
	 * @throws IOException
	 */
	public void stopProjectBuild(String identity, Long serverId, String projectName, Long buildNumber)
	        throws IOException;

	/**
	 * 
	 * @param serverId
	 * @param projectName
	 * @throws IOException
	 */
	public void deleteProject(String identity, Long serverId, String projectName) throws IOException;

}